package TenkindsOfAlgorithm.kruskal;

import graph.GraphArray;

public class Kruskal {
    public static void main(String[] args) {
        String vertexArray[] = {"A","B","C","D","E","F","G"};
        GraphArray graph = new GraphArray(vertexArray.length);
        for (String s : vertexArray) {
            graph.insertVertex(s);
        }
        graph.insertEdge("A","B",5);
        graph.insertEdge("A","G",2);
        graph.insertEdge("A","C",7);
        graph.insertEdge("B","G",3);
        graph.insertEdge("B","D",9);
        graph.insertEdge("D","F",4);
        graph.insertEdge("F","G",6);
        graph.insertEdge("E","F",5);
        graph.insertEdge("E","G",4);
        graph.insertEdge("E","C",8);
        graph.display();
        graph.kruskal(0);
    }
}
